<template>
  <div class="home">
    <el-card class="welcome-card">
      <template #header>
        <div class="card-header">
          <h2 class="welcome-title">✨ 欢迎使用 AI教学系统</h2>
          <p class="welcome-subtitle">智能化教学管理平台，让教育更高效</p>
        </div>
      </template>
      <div class="welcome-content">
        <div class="welcome-text">
          <div class="intro-section">
            <h3 class="section-title">🚀 快速开始</h3>
            <p class="intro-desc">选择左侧菜单功能，体验 AI 驱动的教学工具</p>
          </div>
          
          <div class="features-grid">
            <div class="feature-card" @click="navigateTo('/create_video')">
              <div class="feature-icon">🎬</div>
              <h4>PPT转视频</h4>
              <p>将PPT文件转换为高质量视频演示</p>
            </div>
            
            <div class="feature-card" @click="navigateTo('/create-ppt')">
              <div class="feature-icon">📊</div>
              <h4>教学PPT生成</h4>
              <p>快速生成专业的教学PPT演示文稿</p>
            </div>
            
            <div class="feature-card" @click="navigateTo('/question-generator')">
              <div class="feature-icon">🧠</div>
              <h4>智能出题</h4>
              <p>快速生成各类练习题和试题</p>
            </div>
            
            <div class="feature-card" @click="navigateTo('/videos')">
              <div class="feature-icon">📱</div>
              <h4>视频列表</h4>
              <p>查看和管理已生成的视频内容</p>
            </div>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const navigateTo = (path: string) => {
  router.push(path)
}
</script>

<style scoped>
.home {
  padding: 40px 20px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: calc(100vh - 140px);
}

.welcome-card {
  width: 100%;
  max-width: 900px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: none;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.card-header {
  text-align: center;
  padding: 30px 20px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.welcome-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin: 0;
  font-weight: 300;
  position: relative;
  z-index: 1;
}

.welcome-content {
  padding: 40px 30px;
}

.intro-section {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-desc {
  font-size: 16px;
  color: #7f8c8d;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  margin-top: 30px;
}

.feature-card {
  background: linear-gradient(145deg, #ffffff, #f1f3f4);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(102, 126, 234, 0.1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
  transition: all 0.5s;
}

.feature-card:hover::before {
  left: 100%;
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.feature-card:active {
  transform: translateY(-4px) scale(0.98);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.feature-card h4 {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feature-card p {
  font-size: 14px;
  color: #7f8c8d;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .home {
    padding: 20px 10px;
  }
  
  .welcome-title {
    font-size: 24px;
  }
  
  .welcome-subtitle {
    font-size: 16px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .welcome-content {
    padding: 30px 20px;
  }
}
</style> 